﻿using System.Collections.Generic;

namespace CoreLims.Models.CoreLims
{
    public partial class Reagent
    {
        public class ReagentsTypeCompare : IEqualityComparer<Reagents>
        {
            bool IEqualityComparer<Reagents>.Equals(Reagents x, Reagents y)
            {
                return x.Type == y.Type;
            }

            int IEqualityComparer<Reagents>.GetHashCode(Reagents obj)
            {
                if (string.IsNullOrEmpty(obj.Type))
                { return 0; }
                else
                { return obj.Type.Length; }
            }
        }

        public class RecordTypeCompare : IEqualityComparer<Record>
        {
            bool IEqualityComparer<Record>.Equals(Record x, Record y)
            {
                return x.Type == y.Type;
            }

            int IEqualityComparer<Record>.GetHashCode(Record obj)
            {
                if (string.IsNullOrEmpty(obj.Type))
                { return 0; }
                else
                { return obj.Type.Length; }
            }
        }

    }
}
